{% extends "forum_base.html" %}
{% load forum_tags %}
{% load accounts_tags %}
{% block headtitle %}
    Badge View
{% endblock %}

{% block content %}


    <div class="ui icon attached message">
        <i class="{{ badge.icon }}"></i>
        <div class="content">
            <div class="header">
                {{ badge.name }}
            </div>
            <p>
                {{ badge.desc|title }}
            </p>

        </div>
    </div>

    <div class="ui attached segment">
        Awarded <b>{{ badge.count }}</b> times (<a href="{% url 'badge_list' %}">see all awards</a>). Earned by the
        following contributors:
    </div>

    <div class="ui bottom attached message">


        <div class="ui grid">

            {% for award in awards %}

                <div class="four wide center aligned column">
                    <div class="center aligned author">
                        <a href="{% url "user_profile" award.user.profile.uid %}">
                            <div class="ui circular image">
                                <img class="ui centered image" src="{% gravatar user=award.user size=80 %}">
                            </div>
                        </a>
                    </div>
                    <a href="{% url "user_profile" award.user.profile.uid %}">{{ award.user.profile.name }}</a>
                    {% user_icon user=award.user %}
                    <div>
                        {{ award.date | timesince }} ago
                    </div>
                    <div class="muted">
                        {{ award.user.profile.location |truncatechars:40}}
                    </div>
                    {% if award.post %}
                        <a href="{{ award.post.get_absolute_url }}">{{ award.post.title }}</a>
                    {% endif %}
                </div>

            {% endfor %}

        </div>

        <div class="ui page-bar segment">
            {% pages objs=awards %}
        </div>

    </div>

{% endblock %}
